<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<script type="text/javascript">
    function page(n,s){
        $("#pageNo").val(n);
        $("#pageSize").val(s);
        $("#searchForm").submit();
        return false;
    }
</script>
<div class="app">
    <section class="layout">
        <section class="main-content col-lg-12" id="applicationLeftDiv">
            <div class="content-wrap">
                <div class="wrapper" style="bottom: 50px;">
                    <ul class="nav nav-tabs">
                        <li class="active">
                            <a href="#">库存量消耗列表</a>
                        </li>
                    </ul>
                    <section class="panel panel-default">
                        <div class="panel-body">
                            <div class="table-responsive no-border">
                                <div class="datatable-top">
                                    <div class="pull-left">
                                        <form:form id="searchForm" modelAttribute="drugStorageProfile"
                                                   onsubmit="return loadDivForm('mainCenterDiv','searchForm','${ctx}/drug/drugStorageProfile/findMinMaxList');"
                                                   method="post" class="form-inline">
                                            <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
                                            <input id="pageSize" name="pageSize" type="hidden"
                                                   value="${page.pageSize}"/>
                                                <label class=" control-label">药品名称：</label>
                                                <form:input path="drugName" htmlEscape="false" class="form-control" maxlength="64"/>
                                                <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
                                        </form:form>
                                    </div>
                                </div>
                                <table id="contentTable" class="table table-bordered table-striped mg-t datatable">
                                    <thead>
                                    <tr>
                                        <th hidden>id</th>
                                        <th hidden>infoId</th>
                                        <th>药品名称</th>
                                        <%--<th>厂商</th>--%>
                                        <th>包装规格</th>
                                        <th>包装单位</th>
                                        <th>大包装库存量</th>
                                        <th>小包装库存量</th>
                                        <th>消耗量</th>
                                        <th>大包装库存下限</th>
                                        <th>大包装库存上限</th>
                                        <th>操作</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <c:forEach items="${page.list}" var="drugStorageProfile">
                                        <tr>
                                            <td hidden> ${drugStorageProfile.id}</td>
                                            <td hidden> ${drugStorageProfile.infoId}</td>
                                            <td> ${drugStorageProfile.drugName}</td>
                                            <%--<td> ${drugStorageProfile.firmId}</td>--%>
                                            <td> ${drugStorageProfile.packageSpec}</td>
                                            <td> ${fns:getDictLabels(drugStorageProfile.packageUnits, 'SPEC_UNIT', '')}</td>
                                            <td> ${drugStorageProfile.quantity/drugStorageProfile.packageNum}</td>
                                            <td> ${drugStorageProfile.quantity}</td>
                                            <td> ${drugStorageProfile.outQuantity/drugStorageProfile.packageNum}</td>
                                            <td> ${drugStorageProfile.minQuantity/drugStorageProfile.packageNum}</td>
                                            <td> ${drugStorageProfile.maxQuantity/drugStorageProfile.packageNum}</td>
                                            <td>
                                                <a href="#" onclick="loadDiv('rigthCenterDiv', '${ctx}/drug/drugStorageProfile/saveProfile?infoId=${drugStorageProfile.infoId}'),addDrugList()" class="btn btn-primary">调 整</a>
                                            </td>
                                        </tr>
                                    </c:forEach>
                                    </tbody>
                                </table>
                                <div class="pagination">${page}</div>
                            </div>
                        </div>
                    </section>
                </div>
            </div>
        </section>
        <section class="main-content col-lg-4" style="display: none" id="applicationRightDiv">
            <div class="content-wrap" id="rigthCenterDiv">
            </div>
        </section>
    </section>
</div>

<script type="text/javascript">
    <%--function remove(row) {--%>
        <%--console.log(row);--%>
    <%--}--%>
    function addDrugList(infoId) {
        $("#applicationLeftDiv").attr("class", "main-content col-lg-8");
        $("#applicationRightDiv").show('normal');
    }
</script>